package com.exam.controller;

import com.exam.service.ExaminationAnswerService;
import com.exam.utils.ResultVOUtil;
import com.exam.vo.ResultVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Created by v
 * Date:2019/2/23
 * Time:16:03
 */
@RestController
@RequestMapping("/user/examination")
@Slf4j
public class ExaminationAnswerController {

    @Autowired
    private ExaminationAnswerService examinationAnswerService;

    /**
     * 用户答题
     * @param map
     * @param request
     * @return
     */
    @PostMapping("/answer")
    public ResultVO examinationLaunch(@RequestBody Map<Object, Object> map, HttpServletRequest request) {

        examinationAnswerService.inputAnswer(map, request);

        return ResultVOUtil.success("答案提交成功");

    }
}
